/*
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * Portions created by the Initial Developer are
 * Copyright (C) 2012 the Initial Developer.
 * All Rights Reserved.
 *
 * The Original Code is "http://semi-frame.googlecode.com/svn/trenk/".
 *
 * The Initial Developer of the Original Code is the author below.
 */
/**
 * @file TimerConfig.h
 * @brief auto generated.
 * @author mornongcloud
 * @date 2011/07/21
 */

#ifndef SEMICONFTIMERCONFIG_H_
#define SEMICONFTIMERCONFIG_H_

#include "semi/conf/TasksConfig.h"
#include "semi/util/DateUtil.h"

namespace semi {
namespace conf {

/*
 * TimerConfig
 *
 */
class TimerConfig {
public:
	TimerConfig();
	TimerConfig(std::string taskId);
	TimerConfig(TasksConfig::TaskConfig tconf);
	virtual ~TimerConfig();

	void init(TasksConfig::TaskConfig tconf);

	int getDelay();
	bool isValid();

	std::string TaskId;

	short span;

private:

	void loadConfig(std::string taskId);

	void setDate(short y, short m, short d);
	void setTime(short hour, short min, short sec);
	//    void setMin(short min, short sec);
	//    void setSec(short sec);

	short y, m, d;
	short h, min, s;
};

}
}
#endif /* TIMERCONFIG_H_ */
